<!-- 
 * 消息中心
 * @author: 
 * @since: 2022-05-11
 * index.vue
-->
<template>
  <div class="info-container h100">
    <router-view v-show="routerCutLevel === 3" class="detailsPage"></router-view>
    <div v-show="routerCutLevel === 2" class="listPage">
      <div class="tabs">
        <el-button type="primary" @click="tabsClick(1)" :class="{ isClick: state.tabsActive === 1 }" size="mini">
          <span class="btn-word">自定义消息</span>
        </el-button>
        <el-button type="primary" @click="tabsClick(2)" :class="{ isClick: state.tabsActive === 2 }" size="mini">
          <span class="btn-word">消息模板</span>
        </el-button>
      </div>
      <customInfo v-if="state.tabsActive === 1"></customInfo>
      <infoTemplate v-if="state.tabsActive === 2"></infoTemplate>
    </div>
  </div>
</template>

<script setup>
import { reactive, computed } from 'vue'
import { useRouter } from 'vue-router';
import { useStore } from 'vuex';
const router = useRouter();
const store = useStore();


const state = reactive({
  tabsActive: 1,//1.自定义消息 2.消息模版
})

const tabsClick = (type) => {
  state.tabsActive = type
}

const routerCutLevel = computed(() => {
  return store.getters['setting/routerCutLevel'];
});
</script>

<style lang="scss" scoped>
.info-container {
  .tabs {
    padding: 20px 20px 0 20px;
    .el-button {
      color: #00a2ff;
      background: #fff;
      border: 1px solid #e3e3e3;
      transition: all, 0.3s;
    }
    .isClick {
      color: #fff;
      background: #00a2ff;
      border: 1px solid #00a2ff;
    }
  }
}
</style>
